<?php
/* @var $this UsuarioController */
/* @var $model Usuario */

$this->breadcrumbs=array(
	'Usuarios'=>array('index'),
	
);

$this->menu=array(
	array('label'=>'Cadastrar professor', 'url'=>array('administrar/professor/create')),
);

?>


<?php 

Yii::app()->clientScript->registerScript('search', "
$('.search-button').click(function(){
	$('.search-form').toggle();
	return false;
});
$('.search-form form').submit(function(){
	$('#serie-grid').yiiGridView('update', {
		data: $(this).serialize()
	});
	return false;
});
");
?>

<div class="form">
<div class="row">

<p> Selecione o professor para a orientação </p>
<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'professores-form',
	// Please note: When you enable ajax validation, make sure the corresponding
	// controller action is handling ajax validation correctly.
	// There is a call to performAjaxValidation() commented in generated controller code.
	// See class documentation of CActiveForm for details on this.
	'enableAjaxValidation'=>false,
)); ?>


<?php

$this->widget('zii.widgets.grid.CGridView', array(
        'id'=>'professores-grid',
        'dataProvider'=>new CArrayDataProvider($model),
    'selectableRows' => 2,
	'summaryText' => '',
        'columns'=>array(
        array('id' => 'selectedIds',
                        'class'=>'CCheckBoxColumn',    
					),

        array(
            'name'  => 'id',
            'htmlOptions' => array('style'=>'width:30px;'),
        ),
		  array(
            'name'  => 'Perfil',
            'value' => '$data->perfil->nome',
        ),
		'nome',
		'email',
		'telefone',
		
))); ?>
</div>

<p>Selecione e clique abaixo para mudar o perfil do professor</p>
	<div class="row buttons">
		<?php echo CHtml::submitButton('Mudar perfil'); ?>
	</div>
	
	<?php $this->endWidget(); ?>
	
	</div>
	
